#ifndef THERMAL_RESERVOIR_SIMULATOR_H
#define THERMAL_RESERVOIR_SIMULATOR_H

#include BS_FORCE_PLUGIN_IMPORT ()
#include "reservoir_simulator.h"
#include BS_STOP_PLUGIN_IMPORT ()

#include "thermal_main_loop_calc.h"
#include "thermal_calc_model.h"
#include "thermal_jacobian.h"
#include "thermal_reservoir.h"

namespace blue_sky{

	template <class strategy_t>
	class BS_API_PLUGIN thermal_reservoir_simulator : public reservoir_simulator<strategy_t>
	{
	public:
		
		typedef reservoir_simulator<strategy_t>					base_t;
		typedef main_loop_calc_base <strategy_t>				main_loop_calc_t;     //!< base type of main_loop_calc type
		typedef thermal_calc_model < strategy_t >				thermal_calc_model_t;         //!< calc_model type
		typedef smart_ptr <thermal_calc_model_t, true>			sp_thermal_calc_model_t;

		typedef calc_model < strategy_t >						calc_model_t;         //!< calc_model type
		typedef smart_ptr < calc_model_t, true >				sp_calc_model_t;      //!< smart_ptr to calc_model type

		typedef thermal_jacobian <strategy_t>					thermal_jacobian_t;           //!< jacobian type
		typedef smart_ptr <thermal_jacobian_t, true>			sp_thermal_jacobian_t;        //!< smart_ptr to jacobian type

		typedef thermal_reservoir<strategy_t>					thermal_reservoir_t;          //!< reservoir type
		typedef smart_ptr <thermal_reservoir_t, true>			sp_thermal_reservoir_t;       //!< smart_ptr to reservoir type

		typedef typename strategy_t::index_t					index_t; 
		typedef smart_ptr<build_boundary<strategy_t>, true>		sp_boundary_builder;	

		typedef rs_smesh_iface <strategy_t>                     smesh_iface_t;
		typedef smart_ptr <smesh_iface_t, true>                 sp_smesh_iface_t;
		typedef typename smesh_iface_t::index_point3d_t			index_point3d_t;

		/*!
		* \brief destructor
		*/
		 ~thermal_reservoir_simulator();

		 virtual main_loop_calc_t *get_main_loop ();

		 void init();

		/**
		* \brief  checks all data
		* \param  mesh pointer to mesh instance
		* \param  data pointer to data storage (pool)
		* */
		virtual void check_data (const smart_ptr <rs_mesh_iface <strategy_t>, true> &mesh, const smart_ptr <idata, true> &data);

		//! blue-sky type declaration
		BLUE_SKY_TYPE_DECL_T(thermal_reservoir_simulator);

		sp_boundary_builder boundary_builder;
	};

	bool thermal_reservoir_simulator_register_type (const blue_sky::plugin_descriptor &pd);
}
#endif //THERMAL_RESERVOIR_SIMULATOR_H